<template>
  <div class="dashboard-container">
    <div class="dashboard-text">
      <!-- <el-row>
        <el-col>
        <div class="grid-content bg-purple tao" >
          <el-col>
          <Taos></Taos>
          </el-col>
        </div>
        </el-col>
      </el-row> -->
      <el-row :gutter="20">
        <el-col :span="4"
          ><div class="grid-content bg-purple" />
          <el-card shadow="always" class="card">
            <div class="main">
              <i class="el-icon-user" />
              <div class="right">
                <p>管理员用户</p>
                <p>{{ list[0] }}名</p>
              </div>
            </div>
          </el-card>
          <el-card shadow="always" class="card secondCard">
            <div class="main">
              <i class="el-icon-tickets" />
              <div class="right">
                <p>教师用户</p>
                <p>{{ list[1] }}名</p>
              </div>
            </div>
          </el-card>

          <el-card class="box-card">
            <Ho></Ho>
          </el-card>
        </el-col>

        <el-col :span="16">
          <div class="grid-content bg-purple tao">
            <el-col>
              <Taos></Taos>
            </el-col>
          </div>
        </el-col>
        <el-col :span="4"
          ><div class="grid-content bg-purple" />
          <el-card shadow="always" class="card thirdCard">
            <div class="main">
              <i class="el-icon-reading" />
              <div class="right">
                <p>书本数量</p>
                <p>{{ list[2] }}名</p>
              </div>
            </div>
          </el-card>
          <el-card shadow="always" class="card fourthCard">
            <div class="main">
              <i class="el-icon-school" />
              <div class="right">
                <p>班级数量</p>
                <p>{{ list[3] }}名</p>
              </div>
            </div>
          </el-card>
          <el-card class="box-card">
            <Ming></Ming>
          </el-card>
        </el-col>
      </el-row>
    </div>
  </div>
</template>

<script>

import Ho from "./components/ho.vue";
import Ming from "./components/ming.vue";
import Taos from "./components/taos.vue";
import { faData } from "@/api/tao";
export default {
  name: "Dashboard",
  data() {
    return {
      list: [],
    };
  },
  components: {
    
    Ho,
    Ming,
    Taos,
  },
  created() {
    this.faData();
  },
  methods: {
    async faData() {
      const res = await faData();
      console.log(res);
      this.list = res.data.data.score;
    },
  },
};
</script>

<style lang="scss" scoped>
.dashboard {
  &-container {
    margin: 30px;
  }
  &-text {
    font-size: 30px;
    line-height: 46px;
  }
}
.card {
  text-align: center;
  background-color: #f56c6c;
  margin-bottom: 10px;
}
.secondCard {
  background-color: #2a75d6;
}
.main {
  display: flex;
  align-items: center;
  color: #fff;
}
.right {
  margin-left: 40px;
  font-size: 16px;
}

::v-deep .el-card__body {
  padding: 10px;
}
.dashboard-text {
  line-height: 25px;
}
.thirdCard {
  background-color: #67c23a;
}
.fourthCard {
  background-color: #409eff;
}
i {
  margin-left: 46px;
}
</style>
